Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add HTML response handling for target allocator #3652

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CharlieTLe
Copy link
Contributor

@CharlieTLe CharlieTLe commented Jan 22, 2025

Description:
Adds support for HTML output in the target allocator.

Link to tracking Issue(s):

Testing:

Configured unit tests with golden files to test that HTML renders the correct response.

To start the test, run

make prepare-e2e

Setup a TA

# Sets up ClusterRole with full access to all resources and nonResourceURLs
# This is just for demonstration purposes and should not be used in production
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: ta
rules:
- apiGroups: [ '*' ]
  resources: [ '*' ]
  verbs: [ '*' ]
- nonResourceURLs: [ '*' ]
  verbs: [ '*' ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: ta
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ta
subjects:
  - kind: ServiceAccount
    name: ta-targetallocator
    namespace: default
---
# Sets up the TargetAllocator
apiVersion: opentelemetry.io/v1alpha1
kind: TargetAllocator
metadata:
  name: ta
  namespace: default
spec:
  # Sets up the ServiceMonitor for the TA
  observability:
    metrics:
      enableMetrics: true
  # Set up watching of ServiceMonitors
  prometheusCR:
    enabled: true
    serviceMonitorSelector: {}

Port-forward to the TA pod.

kubectl port-forward -n default deploy/ta-targetallocator 8080:8080

Once port-forwarded, go to http://localhost:8080.

Screenshots:

Home

home

Scrape Configs

scrape_configs

Jobs

jobs

Targets

targets

Collector

collector

Job

job

Target

target

@CharlieTLe CharlieTLe force-pushed the otel-targetallocator-html branch from c9c6e2a to d6cb377 Compare January 23, 2025 02:45
@CharlieTLe CharlieTLe force-pushed the otel-targetallocator-html branch 2 times, most recently from 4fc7fa4 to 76cf475 Compare January 24, 2025 02:08
@CharlieTLe CharlieTLe marked this pull request as ready for review January 24, 2025 05:07
@CharlieTLe CharlieTLe requested a review from a team as a code owner January 24, 2025 05:07
Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look ok to me.

@CharlieTLe CharlieTLe force-pushed the otel-targetallocator-html branch from e7ca1d8 to b4f43e2 Compare March 16, 2025 21:05
@CharlieTLe CharlieTLe changed the title feat: add HTML response handling for job and target endpoints feat: add HTML response handling for target allocator Mar 16, 2025
Signed-off-by: Charlie Le <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI for Jobs and Scrape Configs in Target Allocator Server
3 participants